import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
from selenium.webdriver.support.select import Select
testCase="DBshop012_后台商品管理-搜索商品流程"
MeiDiNumber='DBS000006'

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','管理商品')
firefox.find_element_by_name('goods_name').send_keys('美的')
firefox.find_element_by_xpath('(//button[@type="submit"])[1]').click()

a=firefox.find_element_by_xpath('//table/tbody/tr[2]/td[4]').text
print('a=',a)
if a==(MeiDiNumber):
    print('%s   测试通过'%testCase)
else:
    print('%s   测试失败'%testCase)
#
# time.sleep(2)
# firefox.quit()

# firefox.quit()

# firefox=openBrowser(url)
# DBshopLogin(firefox,userName,password)
#
# firefox.find_element_by_link_text("我的订单").click()
# firefox.find_element_by_link_text('退货申请').click()
#
# a=firefox.find_element_by_xpath('//table/tbody/tr/td[4]').text
# if a == ('退款成功'):
#     print('%s   测试通过'%testCase)
# else:
#     print('%s   测试失败'%testCase)
#
# time.sleep(2)
# firefox.quit()